<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <!-- 将过滤后的字母都从小写变成大写 -->
    <div id="app">
        <div v-bind:id="idName | filterIdName"></div>
        {{msg | daXie}}
    </div>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                msg: 'hello world!',
                idName: '12hh'
            },
            filters: {
                daXie (value) {
                    return value ? value.toUpperCase() : ''
                },
                filterIdName (value) {
                    return value.slice(2)  //'hh'
                }
            }
        })
        console.log(vm)
    </script>
</body>
</html>